package cn.iocoder.yudao.framework.business.basic.pojo.vo;

import cn.iocoder.yudao.framework.business.address.pojo.vo.PrimaryAddressVO;
import cn.iocoder.yudao.framework.business.basic.pojo.bo.BusinessHours;
import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.MobileDesensitize;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;

import java.time.LocalTime;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  视图对象
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2024/06/11
 */
@Tag(name = "用户信息 VO")
@Data
public class ShopSimpleVO extends PrimaryAddressVO implements BusinessHours, VO {
    public static final ShopSimpleVO EMPTY = new ShopSimpleVO();

    static {
        EMPTY.setId(0L);
        EMPTY.setName("未知");
        EMPTY.setLogo("");
    }

    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "羡民")
    private String name;

    @Schema(description = "徽标", requiredMode = Schema.RequiredMode.REQUIRED)
    private String logo;

    @Schema(description = "负责人姓名", example = "羡民")
    private String contactName;

    @Schema(description = "负责人电话", example = "15285116029")
    @MobileDesensitize(disable = "@ss.hasAnyRoles('super_admin', 'platform_admin', 'tenant_admin')")
    private String contactMobile; // 手机号码为敏感的隐私数据，避免明文返回给前端

    @JsonIgnore
    private LocalTime openingTime;
    @JsonIgnore
    private LocalTime closingTime;

    @SuppressWarnings("unused")
    @Schema(description = "营业时间")
    public String getBusinessHours() {
        return formatBusinessHours(getOpeningTime(), getClosingTime());
    }

    @Schema(description = "评分", example = "5.0")
    private float score;

}
